<template>
  <view class="container">
    <view class="header">
      <uni-icons type="left" size="23" style="vertical-align: middle" @click="goback"></uni-icons>
      <text style="font-size: 36rpx; font-family: PingFang SC, PingFang SC; font-weight: bold; color: #222222; padding-left: 20rpx">消息详情</text>
    </view>
    <view class="box"><rich-text :nodes="text"></rich-text></view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      text: ''
    };
  },
  onLoad(opt) {
    console.log(opt.id);
    this.getmsgdetail(opt.id);
  },
  methods: {
    // 获取消息详情
    async getmsgdetail(id) {
      const res = await uni.$http.post('user/getNoteInfo', {
        note_id: id
      });
      console.log('--------res---', res.data.data);
      this.text = res.data.data.content;
    },
    goback() {
      uni.navigateBack();
    }
  }
};
</script>

<style lang="scss" scoped>
.container {
  .header {
    margin-top: 60rpx;
    margin-left: 30rpx;
  }
  .box {
    padding: 30rpx;
  }
}
</style>
